package com.example.demo.controller;


import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/love")
    public String sayLove(String name) {
        if (!StringUtils.hasLength(name)) {
            name = "张玉婷";
        }
        System.out.println("执行了 sayLove 方法");
        return "李家强爱" + name;
    }

    @RequestMapping("/hello")
    public String sayHello() {
        System.out.println("执行了 sayHello 方法");

        return "hello 张玉婷";
    }
}
